'use strict';
const dayjs = require("dayjs");
module.exports = app => {
    const { INTEGER, STRING, TEXT, JSON} = app.Sequelize;
    return app.model.define(
        'DailySummary',
        {
            id: {type: INTEGER, primaryKey: true, autoIncrement: true},
            device_id: STRING,
            api_name: TEXT,
            date: STRING,
            farm_id: STRING,
            data: JSON,
        },
        {
            tableName: 'daily_summary',
            timestamps: true, // 启用时间戳(createdAt, updatedAt)
            updatedAt: false, // 不想要 updatedAt
            createdAt: false, // 想要  createdAt 但是希望名称叫做 create_time
        }
    );
};

